package com.situ.vivamarket.controller.sys;

import com.situ.vivamarket.service.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
@RequestMapping("/vm/sys/goods")
public class GoodsController {
    private GoodsService goodsService;
    @Autowired
    public void setGoodsService(GoodsService goodsService) {
        this.goodsService = goodsService;
    }

    @GetMapping("/list")
    public String list() {
        return "sys/goods/list";
    }

    @GetMapping("/add")
    public String add() {
        return "sys/goods/add";
    }

    @GetMapping("/edit")
    public String edit(Integer id, Map<String, Object> map) {
        map.put("id", id);
        return "sys/goods/edit";
    }
    @GetMapping("/show")
    public String show(Integer id, Map<String, Object> map) {
        map.put("id", id);
        return "sys/goods/show";
    }
}
